import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

const path = require('path');

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve:{
    alias: {
      "@" : path.resolve(__dirname, "src"),
      "components": path.resolve(__dirname, "src/components"),
      'vue': 'vue/dist/vue.esm-bundler.js' // 定义vue的别名，如果使用其他的插件，可能会用到别名
    }
  },
  server:{
    proxy:{
      '/shop':{
        target: 'http://localhost:900/shop',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/shop/, '')
      }
    }
  }
})
